import { Tank } from "./tank";

class TankGroup {
  #tankMap: Map<string, Tank> = new Map();
  constructor() {}
  addTank(tank: Tank) {
    this.#tankMap.set(tank.id, tank);
  }
  getAllTank() {
    return [...this.#tankMap.values()];
  }
  deleteTank(id: string) {
    this.#tankMap.delete(id);
  }
  deleteTankAll() {
    this.#tankMap.clear();
  }
}

export const tankGroup = new TankGroup();
